UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Tf5Aeui/XMJfSMp/fMs7/6e2Lh8d2KIRLmDqRuUX60=' 
WHERE 
  key_id = 'c592ba12d3cd2a224fb5d02258a02b0a24f9f9bf27b7e239a40e79af4fad591c' 
  AND (
    token = '8Tf5Aeui/XMJfSMp/fMs7/6e2Lh8d2KIRLmDqRuUX60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046