UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CnPG/uB5cGtAL19M+kf3B6v+qd3aoH20Ys9jzQ2xuts=' 
WHERE 
  key_id = '005f2f91ef7afa729ef62e7ad1d804464437d1e4330d037493069a3414ef14d8' 
  AND (
    token = 'CnPG/uB5cGtAL19M+kf3B6v+qd3aoH20Ys9jzQ2xuts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048