UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1GgOqTrVwx9n3SsRK45v1W1gXDHfy2zjiSFNOIdPD/E=' 
WHERE 
  key_id = '669775d3b635b4fa99b35cbe5e6f06db71dee46616108b407fb36a9c25657bf1' 
  AND (
    token = '1GgOqTrVwx9n3SsRK45v1W1gXDHfy2zjiSFNOIdPD/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037