UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AKAn/WY/V+tDabsukLsekDN810JIatBQ2Q1HlrKoMV4=' 
WHERE 
  key_id = '0588d17cdff86f61ae7de4d1f3e941da6fa24f7cbc52a316b15f8eac569453a2' 
  AND (
    token = 'AKAn/WY/V+tDabsukLsekDN810JIatBQ2Q1HlrKoMV4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028