UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+159LW7zZp6MXY2D6ZSYnjpD/fbwrYphAnQMN6PinRI='
WHERE
key_id = 'efef9187a95d4bb67d8cc378593b450f86b493c87c3c1c0045cea1cfc1391bd2'
AND (
token = '+159LW7zZp6MXY2D6ZSYnjpD/fbwrYphAnQMN6PinRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)