UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eV+KTDH5j6VDna7urTDep1IOuQRa25rv2tWztm2oOm8=' 
WHERE 
  key_id = 'fd0d072a6ea64c9c486d625c3e1a2756d894407b20563ceb4cb3ff172864c7a9' 
  AND (
    token = 'eV+KTDH5j6VDna7urTDep1IOuQRa25rv2tWztm2oOm8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044