UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'givSq+PZPAbGj+/Eg31IS79AVn2RPLXLIc9v0tkqG1c=' 
WHERE 
  key_id = 'b0c99e6aa0a7af27cee77b2b2a8ad8b1ec96d20491e7052d94d1d13abf796b7b' 
  AND (
    token = 'givSq+PZPAbGj+/Eg31IS79AVn2RPLXLIc9v0tkqG1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036