UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yjGfb9wUr/Zsukdb1GBpfpIGnNyzArL+AqepfR0TWhM='
WHERE
key_id = 'ca2bbfd6d04edf31a6695fa7b7bd53c0eae8460094ced2d60292e20d8e7d76ba'
AND (
token = 'yjGfb9wUr/Zsukdb1GBpfpIGnNyzArL+AqepfR0TWhM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)