UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'weIjr5iF7BCj2mlZs72D5p/b+1QWKMX+ji9MbPOvWkw=' 
WHERE 
  key_id = '6fd4ba0da96390b1974cfcc0a5f266cd0cb13813cd9a91b9f61e43743d5badf3' 
  AND (
    token = 'weIjr5iF7BCj2mlZs72D5p/b+1QWKMX+ji9MbPOvWkw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034