UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9WsoRqRw4vuEKqzKpSs3KO60MR23YDdq8aIaL3/hbMY=' 
WHERE 
  key_id = 'fbb54ddd987ae197a2fed11d7a15572ee5538ffb19b15c5b3dd9399842b44038' 
  AND (
    token = '9WsoRqRw4vuEKqzKpSs3KO60MR23YDdq8aIaL3/hbMY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033