UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OjxxQf16Hxj02yzPW/IJzVaM8xXXBQMU/O6XWzHb62Q=' 
WHERE 
  key_id = '6dd21286d2b9d265cf37483ce02d6d8f831642e3c56ca3a0cc278a1b3a843bbe' 
  AND (
    token = 'OjxxQf16Hxj02yzPW/IJzVaM8xXXBQMU/O6XWzHb62Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016