UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9kyZkn6YKBc/tcNRAnRS2KRT1G1JafVPcnrlVxBkSHk=' 
WHERE 
  key_id = '3793cf20a8c5d8c37fffe1633edc3b004d79b7f0d1f9672eb16b735e54be2a39' 
  AND (
    token = '9kyZkn6YKBc/tcNRAnRS2KRT1G1JafVPcnrlVxBkSHk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034