UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'enV4ARllIh9ixtkGV+dF68lVbJ0l4xVRwvh4mVG5790=' 
WHERE 
  key_id = '29856c0fb1f7f518abaa29ea008f52501883d28c8c0df2d8bb922db4bccbaeab' 
  AND (
    token = 'enV4ARllIh9ixtkGV+dF68lVbJ0l4xVRwvh4mVG5790=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023