UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/X86TC6zQ0w9WjGPoRUW3nwfugEb+68yjqboHEqNR8w=' 
WHERE 
  key_id = '9d8b5b322b829d0cd635c6216242eb85043ffcf2d07d97fe1ba252e97e5d4cf2' 
  AND (
    token = '/X86TC6zQ0w9WjGPoRUW3nwfugEb+68yjqboHEqNR8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00132