UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DucdmmuT53KPpMdQcJgr2uxky5jouClF6F8acuCbN5U=' 
WHERE 
  key_id = '07739c5802d0dbd5d0aa4861b20531d5de495934bff6c44271eb15a31a440c8f' 
  AND (
    token = 'DucdmmuT53KPpMdQcJgr2uxky5jouClF6F8acuCbN5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033