UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ofo1yN5uNKMEXztnHJlTc4CYRjyIdfcROw7nQGt/VhE=' 
WHERE 
  key_id = 'a11fa58222e6c06383df6247f7f96ffc3f723554611e511186a44e489f6ac9c3' 
  AND (
    token = 'Ofo1yN5uNKMEXztnHJlTc4CYRjyIdfcROw7nQGt/VhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035