UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XNbB0JYnZ9Epe2xd7lPD/3MYdMqqnic5XpoxQLFPn/Y=' 
WHERE 
  key_id = '8e35014484a1bc2a04435cfa7f618416e83159726a54887d9e1c3e9926fc2d72' 
  AND (
    token = 'XNbB0JYnZ9Epe2xd7lPD/3MYdMqqnic5XpoxQLFPn/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023