UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A7oX8VUPo/Xn6DZb6WEr9YtoCiOPBVuEWATwmla/qwk=' 
WHERE 
  key_id = '813dd5a34f7750c411e299927322f46d0288dcc9362d112ecd2ed15fa3ca62bf' 
  AND (
    token = 'A7oX8VUPo/Xn6DZb6WEr9YtoCiOPBVuEWATwmla/qwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026