UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RaNVrBu/KaqvihA/6cUs3mDxAZm58Vr5/SzlOZ0JVHA=' 
WHERE 
  key_id = '6327b9a486db4cf135651a81e8d3bdbfe25c78288fb5e51bdf25653718059151' 
  AND (
    token = 'RaNVrBu/KaqvihA/6cUs3mDxAZm58Vr5/SzlOZ0JVHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023