UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ccY+FEW7rAmHVS7Ua13YbcZ4j2U8N7hu4ho1S8q/mNk='
WHERE
key_id = '392d6b93547d8c2c2b44a1a9d46e8a8b7ac830199d1b47edc6e00a3ae7aaedbb'
AND (
token = 'ccY+FEW7rAmHVS7Ua13YbcZ4j2U8N7hu4ho1S8q/mNk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)