UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DwC4oeHAf/rwF0asqJjy3u4ceInLJl/xpMUbL3rTaF0=' 
WHERE 
  key_id = '1231f0667c4866bc9804005da633cd58fe452c73fe5d4fee3f1c01e234460712' 
  AND (
    token = 'DwC4oeHAf/rwF0asqJjy3u4ceInLJl/xpMUbL3rTaF0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029