UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K/9NZT7NVpHuPsLZkJrYd6BGpVzCTs1ojp2M8yOlXck=' 
WHERE 
  key_id = '1452d08026fab0c0e58191907d7eb57bd4a4fca0fd09020f5761071005d43f63' 
  AND (
    token = 'K/9NZT7NVpHuPsLZkJrYd6BGpVzCTs1ojp2M8yOlXck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022