UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b0Sxx4oNQomw30ZDDE3bbn7k4uyzCSmdIf9L/hff3dg='
WHERE
key_id = '043942c0a7cb9ca461cb798ee416b37ff3d763ebd5587cdf7c50a235c05a24e4'
AND (
token = 'b0Sxx4oNQomw30ZDDE3bbn7k4uyzCSmdIf9L/hff3dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)