UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2C/7jrDCnK2XE8xlnc03drpHO7J9Za/qcCSTswCCL0w=' 
WHERE 
  key_id = '1d027a2c08357f3d975ca21746923b691643192e170a5200160957ff74b26d02' 
  AND (
    token = '2C/7jrDCnK2XE8xlnc03drpHO7J9Za/qcCSTswCCL0w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038