UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OjQ9Jo31KOnDf0v12GdnevlXqlkac8Aw5RPLG3F4c0I='
WHERE
key_id = '0afab6b84b698d6057f6c5ca4b452fce09683da57cb8b3d888263f8542aff4a4'
AND (
token = 'OjQ9Jo31KOnDf0v12GdnevlXqlkac8Aw5RPLG3F4c0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)