UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DNYWWx0/I1xBaf8flxpKEaf7a5u4nWtnI5qdIhqB4Bk='
WHERE
key_id = '2b5edb8caf372d115fad4f35e4efc49ad3094086adeff5387481271da90941c1'
AND (
token = 'DNYWWx0/I1xBaf8flxpKEaf7a5u4nWtnI5qdIhqB4Bk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)