UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OnVx9coR2JBkZyZT74d92uIyaytUoCKw6WgMK5xLUhI=' 
WHERE 
  key_id = 'be8f92e69e5539c2a9e630e0b020c87efd9dd5b9fa9c4422141fbffbeca0f1df' 
  AND (
    token = 'OnVx9coR2JBkZyZT74d92uIyaytUoCKw6WgMK5xLUhI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020