UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm+VIJ0X9ScB6+/5HppSYUjKRtxaZ6Wyc/1FbdNeKt1Q=' 
WHERE 
  key_id = 'ac4badb5af91ebe2dc1d53ac45889f1472365b92906584b4ee1210445dfce583' 
  AND (
    token = 'm+VIJ0X9ScB6+/5HppSYUjKRtxaZ6Wyc/1FbdNeKt1Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022