UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zmlihAujj+XHApJIXd4c6hnt+e/7oy13J09YvlJtaXc=' 
WHERE 
  key_id = 'e3e0e6e23e01a3cde44b25c15885a1d36fe9d2c31e29289e72c5f04a67a1e614' 
  AND (
    token = 'zmlihAujj+XHApJIXd4c6hnt+e/7oy13J09YvlJtaXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019