UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PsZpXLcpsBYGz5Qg+GrNN7GZyIx6+3yNm9WrvuNJ9xk='
WHERE
key_id = 'bd5e08b8fc77d120b1f8de1e778c291b75468e03557eb49beefbd3fbeb084d70'
AND (
token = 'PsZpXLcpsBYGz5Qg+GrNN7GZyIx6+3yNm9WrvuNJ9xk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)