UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WRDi4SKCwGbKBXvXmn4zHcGrDb8aHgmoXziqd1zlOMQ='
WHERE
key_id = 'b2bf1c0844ad49afe9cc63a7edcfbe5dab665b3e883148a5635eda54aa3f2836'
AND (
token = 'WRDi4SKCwGbKBXvXmn4zHcGrDb8aHgmoXziqd1zlOMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)