UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'olsbHTGz+nDdXph6I2sKHYxwAgN83zVgNIz5p1cbDLE='
WHERE
key_id = '8ce5fcde6b2967df6da2c15d05c437750e08f311d5008871eed1dc7dc1146ef3'
AND (
token = 'olsbHTGz+nDdXph6I2sKHYxwAgN83zVgNIz5p1cbDLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)