UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9S0KXMIZqesT6jxyacXFftNHzQ2Bvz1ZhRU/Qp1R9AY=' 
WHERE 
  key_id = 'fcac8e7b719c94a7675fb4beeaa9bcad50cd86de83251b9dc88b70fee124fee3' 
  AND (
    token = '9S0KXMIZqesT6jxyacXFftNHzQ2Bvz1ZhRU/Qp1R9AY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031