UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ge5yWOwDoipZSm4Xw8SvjjfIBGhFBW2CNwyHgg5BNo=' 
WHERE 
  key_id = '11dcaa6119d2d435b35112d0402f67a809b7bd90ef73ac68624fea57f922bb17' 
  AND (
    token = '1ge5yWOwDoipZSm4Xw8SvjjfIBGhFBW2CNwyHgg5BNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029