UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jctu4oDjL8RRfoXQkigklfFvL/GGJwO4/OwMEmf+yPQ=' 
WHERE 
  key_id = '655ac28d9f01be942e7aa0a8827d6bdc6d069206dbeff13c602c40516c958857' 
  AND (
    token = 'jctu4oDjL8RRfoXQkigklfFvL/GGJwO4/OwMEmf+yPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058