UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UCu3a5ro4g6Q1HDgAx3LcmfQgWZAwe16rELpggfQQUw=' 
WHERE 
  key_id = '73750a7d00996eac8640f438d519a3a2e4a3cda954481219a623a9422e28a533' 
  AND (
    token = 'UCu3a5ro4g6Q1HDgAx3LcmfQgWZAwe16rELpggfQQUw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050