UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qRMJlnSYwcIii8XeUYF/m2SlAH0EEx14W9hOgllG4aQ='
WHERE
key_id = '28a1212d167dad9bdb6bdb80aa4b1ebeead13ab95388da7de4ea6ad2d589f1ae'
AND (
token = 'qRMJlnSYwcIii8XeUYF/m2SlAH0EEx14W9hOgllG4aQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)